package code;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class one {
    public static void main(String[] args) throws IOException {


        ServerSocket serverSocket = new ServerSocket(8888);

        while(true) {
            new Thread(new ServerThread(serverSocket.accept())).start();
        }

//        Socket socket = serverSocket.accept();
//        String filename = "default";
//        OutputStream outputStream = new FileOutputStream("E:\\" + filename + ".jpg");
//        BufferedWriter result = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
//        InputStream inputStream = socket.getInputStream();
//
//        int b = 0;
//
//        while ((b = inputStream.read()) != -1) {
//            outputStream.write(b);
//        }
//        result.write("over");
//        result.newLine();
//        result.flush();

    }
}
